﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Business;
using Should;

namespace UnitTestBokning
{
    [TestClass]
    public class TestDateHandler
    {
        [TestMethod]
        public void DateHandler_EnsureThatWeekOneChangesCorrectly()
        {
            int weekNumber = DateHandler.GetWeekForDate(new DateTime(2012, 12, 30));
            weekNumber.ShouldEqual(52);
            weekNumber = DateHandler.GetWeekForDate(new DateTime(2012, 12, 31));
            weekNumber.ShouldEqual(1);
            weekNumber = DateHandler.GetWeekForDate(new DateTime(2013, 1, 1));
            weekNumber.ShouldEqual(1);
        }

        [TestMethod]
        public void DateHandler_EnsureThatWeekTwoChangesCorrectly()
        {
            int weekNumber = DateHandler.GetWeekForDate(new DateTime(2013, 1, 6));
            weekNumber.ShouldEqual(1);
            weekNumber = DateHandler.GetWeekForDate(new DateTime(2013, 1, 7));
            weekNumber.ShouldEqual(2);
        }

    }
}
